Skip to content

Expand list of cloud IP addresses - #8

Merged
arp242 merged 1 commit into
mainfrom
rng
Aug 17, 2026
Merged

Expand list of cloud IP addresses#8
arp242 merged 1 commit into
mainfrom
rng

Conversation

@arp242

@arp242 arp242 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

I haven't updated the script to fetch from RIPE/ARIN in quite a few years, and it's ugly and doesn't work. Instead, use: https://github.com/rezmoss/cloud-provider-ip-addresses

Because the list is now a lot longer, using just a slice is too slow: ~40,000ns for the worst case, instead of ~3,800ns. So store as a map of the first byte (or first 2 for IPv6). This makes it consistently ~700ns.

Storing it as a map directly bloats the compiles binary by about 15M, so parse it from text on start-up. That's fast enough so should be okay.

I haven't updated the script to fetch from RIPE/ARIN in quite a few
years, and it's ugly and doesn't work. Instead, use:
https://github.com/rezmoss/cloud-provider-ip-addresses

Because the list is now a lot longer, using just a slice is too slow:
~40,000ns for the worst case, instead of ~3,800ns. So store as a map of
the first byte (or first 2 for IPv6). This makes it consistently ~700ns.

Storing it as a map directly bloats the compiles binary by about 15M, so
parse it from text on start-up. That's fast enough so should be okay.
@arp242
arp242 merged commit fe53d47 into main Aug 17, 2026
11 checks passed
@arp242
arp242 deleted the rng branch August 17, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant